import request from '@/utils/request'

/** 积分商品配置 */

// 平台积分商品列表
export function integralCommodityLs(query) {
  return request({
    url: '/integral/commodity/v1/list',
    method: 'get',
    params: query
  })
}
// 新增平台积分商品列表
export function addIntegralCommodity(data) {
  return request({
    url: '/integral/commodity/v1/add',
    method: 'post',
    data: data
  })
}
// 查询权益卡下拉框
export function getCardOptins(query) {
  return request({
    url: '/integral/commodity/v1/equity/card/list',
    method: 'get',
    params: query
  })
}
// 权益库存下拉框
export function getEquityOptins(query) {
  return request({
    url: '/integral/commodity/v1/equity/inventory/list',
    method: 'get',
    params: query
  })
}
// 平台积分商品详情
export function integralGetInfo(id) {
  return request({
    url: '/integral/commodity/v1/getInfo/' + id,
    method: 'get'
  })
}
// 编辑平台积分商品
export function editIntegral(data) {
  return request({
    url: '/integral/commodity/v1/edit',
    method: 'put',
    data: data
  })
}
// 上架-下架 平台积分商品
export function integralChangeStatus(id) {
  return request({
    url: `/integral/commodity/v1/changeStatus/${id}`,
    method: 'put',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
  })
}
// 积分商品配置 添加库存
export function integralAddStock(params) {
  return request({
    url: '/integral/commodity/v1/addStock',
    method: 'put',
    params
  })
}
// 停用 平台积分商品
export function integralDeactivate(id) {
  return request({
    url: `/integral/commodity/v1/deactivate/${id}`,
    method: 'put',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
  })
}
// 查询CoCo分配列表
export function cocoWalletList(query) {
  return request({
    url: '/platform/coco/wallet/list',
    method: 'get',
    params: query
  })
}
// 中台 用户兑换订单列表
export function changeOrderLs(query) {
  return request({
    url: '/customer/change/order/list',
    method: 'get',
    params: query
  })
}
// 中台 设置 运单号
export function orderSetWaybillNo(params) {
  return request({
    url: '/customer/change/order/setWaybillNo',
    method: 'put',
    params
  })
}
// 运营积分发放列表
export function assetApplyLs(query) {
  return request({
    url: '/platform/asset/apply/list',
    method: 'get',
    params: query
  })
}
// 新增运营积分申请
export function addPlatformAsset(data) {
  return request({
    url: '/platform/asset/apply',
    method: 'post',
    data: data
  })
}
// 前端NFR记录按钮是否显示
export function donationShow(params) {
  return request({
    url: '/system/config/v1/donationShow',
    method: 'put',
    params
  })
}
// 获取 积分运营配置
export function getOperationConfiguration(query) {
  return request({
    url: '/system/config/v1/getOperationConfiguration',
    method: 'get',
    params: query
  })
}
// 神椰集市记录 是否显示 设置
export function commodityShow(params) {
  return request({
    url: '/system/config/v1/commodityShow',
    method: 'put',
    params
  })
}
// 神椰账户 是否显示 设置
export function accountShow(params) {
  return request({
    url: '/system/config/v1/accountShow',
    method: 'put',
    params
  })
}
//神椰入口 是否显示 设置
export function entranceShow(params) {
  return request({
    url: '/system/config/v1/entranceShow',
    method: 'put',
    params
  })
}
// 积分规则设置
export function integralRule(params) {
  return request({
    url: '/system/config/v1/integralRule',
    method: 'put',
    params
  })
}
//产值规则设置
// export function outputRule(params) {
//   return request({
//     url: '/system/config/v1/outputRule',
//     method: 'put',
//     params
//   })
// }
// //产值系数管理 列表
// export function outputManageList() {
//   return request({
//     url: '/output/manage/v1/list',
//     method: 'get',
//   })
// }
// 中台 编辑 产值系数管理
// export function editOutput(data) {
//   return request({
//     url: '/output/manage/v1',
//     method: 'post',
//     data: data
//   })
// }

// 运营积分审批列表
export function assetApplyAuditLs(query) {
  return request({
    url: '/platform/asset/apply/audit/list',
    method: 'get',
    params: query
  })
}
// 运营积分审批
export function applyAuditAudit(params) {
  return request({
    url: '/platform/asset/apply/audit/audit',
    method: 'put',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}
// 运营积分发放信息查询
export function applyIssueInfo(id) {
  return request({
    url: '/platform/asset/apply/issue/info/' + id,
    method: 'get',
  })
}
// 新增用户发放信息
export function addApplyIssueInfo(params) {
  return request({
    url: '/platform/asset/apply/issue/info',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params: params
  })
}
// 执行发放
export function addApplyIssueExecute(params) {
  return request({
    url: '/platform/asset/apply/issue/execute',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params: params
  })
}
// 删除运营积分发放用户信息
export function deleteApplyIssueInfo(id) {
  return request({
    url: `/platform/asset/apply/issue/info/${id}`,
    method: 'DELETE',
  })
}
// 查询发放明细
export function applyIssueRecord(params) {
  return request({
    url: '/platform/asset/apply/issue/record',
    method: 'get',
    params
  })
}
// 删除积分申请
export function deleteAssetApply(id) {
  return request({
    url: `/platform/asset/apply/${id}`,
    method: 'DELETE',
  })
}
//2023-5-18
// 查询通用权益库存下拉框
export function currentInventorySelect(query) {
  return request({
      url: `/common/v1/equity/inventory/select`,
      method: 'get',
      params:query
  })
}
//2023-10-12
// 声望配置列表
export function reputationV1List() {
  return request({
      url: '/reputation/v1/list',
      method: 'get',
  })
}
// 中台 新增声望配置
export function addReputationV1(data) {
  return request({
      url: '/reputation/v1',
      method: 'post',
      data
  })
}
// 中台 编辑声望配置
export function editReputationV1(data) {
  return request({
      url: '/reputation/v1',
      method: 'put',
      data
  })
}
// 中台 删除声望配置
export function delReputationV1(id) {
  return request({
      url: `/reputation/v1/${id}`,
      method: 'delete',
  })
}
// 获取声望配置详情
export function reputationV1GetInfo(id) {
  return request({
      url: `/reputation/v1/getInfo/${id}`,
      method: 'get',
  })
}
// 积分玩法规则设置
export function integralPlayRule(params) {
  return request({
    url: '/system/config/v1/integralPlayRule',
    method: 'put',
    params
  })
}
